<section id="accueil_haut">
    {* Formulaire de recherche *}
    <form id="search_engine" action="{$BASE_URL}" method="post">
        <input class="return" type="text" name="return" value="" required/>
        <input type="hidden" name="todo" value="search" />
        <label for="query">Recherche</label>
        <input type="text" name="q" id="query" class="search_field" size="35" required />
    </form>

    { literal }
        <script>
            autoComplete = {
                element : '#query.search_field',
                data : {
                    serviceUrl: '{ /literal }{ $SYS_FOLDER }{ literal }services/autocomplete/',
                    minChars:2,
                    deferRequestBy: 350,
                    onSelect: function(value, data){
                        jQuery('#query.search_field').removeClass('loading');
                        submitQuery('#query.search_field', value,data);
                    }
                }
            }
        </script>
    { /literal }

    {* La popin d'erreur à afficher *}
    <div>
        { $erreur }
    </div>

    {* Informations exceptionnelles *}
    <div id="infos_accueil">
        { $mea->content }
    </div>
</section>

{* Statistiques *}
<div id="statistiques">
    <div>
        <h2>Derniers relevés</h2>
        <ul>
            { assign var=i value=1 }
            { foreach item=releve from=$lastReleve key=key}
            <li>
                <span>{ $i++  }</span>
                <a href="{$BASE_URL}reports/{ $releve.product._id }-{ $releve.product.name|replace:' ':'-' }">{ $releve.product.name}</a>
            </li>
            {/foreach}
        </ul>
    </div>
    <div>
        <h2>Meilleurs chasseurs</h2>
        <ul>
            { assign var=i value=1 }
            { foreach item=chasseur from=$topChasseur key=key}
            <li>
                <span>{ $i++  }</span>
                <a href="{$BASE_URL}hunters/{ $key }-{ $chasseur.nom|replace:' ':'-' }-{ $chasseur.prenom|replace:' ':'-' }">{ $chasseur.prenom}</a>
            </li>
            {/foreach}
        </ul>
    </div>
    <div>
        <h2>Magasins les - chers</h2>
        <ul>
            { assign var=i value=1 }
            { foreach item=magasin from=$classementMag.most key=key}
            <li>
                <span>{ $i++ }</span>
                <a href="{$BASE_URL}stores/{ $key }-{ $magasin.name|replace:' ':'-' }">{ $magasin.name }</a>
            </li>
            { /foreach }
        </ul>
    </div>
    <div>
        <h2>Villes les + chères</h2>
        <ul>
            { assign var=i value=1 }
            { foreach item=ville from=$topMagCher key=key}
            <li>
                <span>{ $i++ }</span>
                <a href="{$BASE_URL}ville/{ $ville.id }-{ $ville.name|replace:' ':'-' }">{ $ville.name }</a>
            </li>
            { /foreach }
        </ul>
    </div>
</div>